package common.config;

/**
 * Created by Common on 11/26/16.
 */
public class DbTableNames {

    public enum DBType {KG, DOC};

    public enum TBType {VIDEO, PROGRAM, SEQUENCE, SCENE,SHOT, CONCEPT, PROPERTY, INSTANCE};

    public static String[] TB_NAMES = {
            DOCCouchDB.VIDEO_TB, DOCCouchDB.PROGRAM_TB, DOCCouchDB.SEQUENCE_TB,
            DOCCouchDB.SCENE_TB, DOCCouchDB.SHOT_TB,
            KGCouchDB.CONCEPT_TB, KGCouchDB.PROPERTY_TB, KGCouchDB.INSTANCE_TB
    };

    public static class CouchDB{
        public static String getCouchDBName(TBType tb_type){
            int idx = tb_type.ordinal();
            System.out.println("idx = " + idx);
            return TB_NAMES[idx];
        }
    }


    public static class DOCCouchDB{
        public static String DB_NAME = "";
        public static String VIDEO_TB = "video";
        public static String PROGRAM_TB = "program";
        public static String SEQUENCE_TB = "sequence";
        public static String SCENE_TB = "scene";
        public static String SHOT_TB = "shot";
    }

    public static class KGCouchDB{
        public static String DB_NAME = "";
        public static String CONCEPT_TB = "kgmeta";
        public static String PROPERTY_TB = "kgproperty";
        public static String INSTANCE_TB = "kginstance";
    }


    public static class MySQLDB{
        public static final String DB_NAME = "media_search_engine";
        public static final String KG_TABLE_NAME = "kg_couchdb_status";
        public static final String DOC_TABLE_NAME = "doc_couchdb_status";


        public static String getTableName(DBType type ){
            if(type==DBType.DOC){
                return DOC_TABLE_NAME;
            }
            else{
                return KG_TABLE_NAME;
            }
        }
    }


}


